package org.happen.android.ui;

import org.happen.android.R;
import org.happen.android.base.AppActivity;
import org.happen.android.base.BaseLvAdapter;
import org.happen.android.module.TitleModule;
import org.happen.android.widget.PullToRefreshWidget;
import org.liushui.mycommons.android.annotation.ViewInject;
import org.liushui.mycommons.android.annotation.helper.InjectHelper;

import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;

public class DetailActivity extends AppActivity
{
	TitleModule titleModule;
	@ViewInject(R.id.listview)
	ListView listview;
	@ViewInject(R.id.ptrw)
	PullToRefreshWidget pullToRefreshWidget;

	LvAdapter adapter;
	Handler handler;

	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_detail);
		init();
	}

	void init()
	{
		InjectHelper.init(this, this);
		handler = new Handler();
		titleModule = new TitleModule(this, "详细信息");

		listview.addHeaderView(View.inflate(context, R.layout.item_main_lv, null));
		adapter = new LvAdapter();
		listview.setAdapter(adapter);
	}

	class LvAdapter extends BaseLvAdapter
	{

		public int getCount()
		{
			return 10;
		}

		public View getView(int position, View convertView, ViewGroup parent)
		{
			if (convertView == null)
			{
				convertView = View.inflate(context, R.layout.item_detail_lv, null);
			}
			return convertView;
		}

		public void onItemClick(AdapterView<?> adapterView, View view, int position, long id)
		{
		}
	}
}